﻿// @mxmlc -debug=true
/**
* KeyMatcherTest
* @author maze | guavestudios.com
* @version 0.1
*/

package  {

	import com.guavestudios.fcon.util.KeyMatcher;
	import flash.display.StageAlign;
	import flash.display.Sprite;
	import flash.display.StageScaleMode;
	import flash.events.KeyboardEvent;
	
	[SWF(width="1024",height="800",backgroundColor='0xffffff',frameRate='30')]
	public class KeyMatcherTest extends Sprite {
		private var km:KeyMatcher;
		
		//{ STATIC
		
		//}
		
		//{ MEMBERS
		
		//}
		
		//{ GETTER-SETTER
		
		//}
		
		//{ EVENT DEFINITION
		
		//}
		
		//{ INIT
		public function KeyMatcherTest() {
			//Console.setStage(stage);
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			
			init();
		}
		private function init():void {
			
			
			trace(KeyMatcher.createMatcher("Key.220").toString());
			trace(KeyMatcher.createMatcher("crtl+shift+Key.34").toString());
			trace(KeyMatcher.createMatcher("shift+alt+Char.222").toString());
			trace(KeyMatcher.createMatcher("crtl+Key.UP").toString());
			trace(KeyMatcher.createMatcher("Char.U").toString());
			
			km = KeyMatcher.createMatcher("crtl+Key.UP");
			
			stage.addEventListener(KeyboardEvent.KEY_UP, this_up);
		}
		
		private function this_up(e:KeyboardEvent):void {
			trace(km.matchEvent(e));
		}
		//}
		
		//{ PUBLIC METHODS
		
		//}
		
		//{ OVERRIDEN METHODS
		
		//}
		
		//{ PRIVATE METHODS
		
		//}
		
		//{ EVENT HANDLING
		
		//}
		
	}
	
}
